import Vue from 'vue'
import App from './App'
import store from '@/store/store'
Vue.prototype.$store = store;
import * as comm from './util/common.js';
import * as Db from './util/db.js';
import * as api from './util/api.js';
import validate from './util/validate.js';
import * as url from './util/config.js'
Vue.prototype.$db = Db;
Vue.prototype.$comm = comm
Vue.prototype.$api = api;
Vue.prototype.$validate = validate;
Vue.prototype.$url = url;

import tabBar from 'components/tabBar.vue'
Vue.component('tab-bar', tabBar)
Vue.config.productionTip = false

import MescrollBody from "@/components/mescroll-uni/mescroll-body.vue"
import MescrollUni from "@/components/mescroll-uni/mescroll-uni.vue"
Vue.component('mescroll-body', MescrollBody)
Vue.component('mescroll-uni', MescrollUni)
App.mpType = 'app'

// 引入全局uView
import uView from 'uview-ui'
Vue.use(uView);
import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
Vue.mixin(MescrollMixin)
Vue.mixin({
	computed: {
		isLogin() {
			return this.$store.getters.getisLogin
		},
		userInfo() {
			return this.$store.getters.getUserInfo
		},
		get_address(){
			return this.$store.getters.getAddress
		}
	}
})


Vue.filter('get_infoType', function(infoType) {
	return ['发布领养', '我想领养', '寻宠启示', '宠物二三事'][infoType]
})
Vue.filter('get_state', function(state, type) {
	let strategy = {
		infoVaccines: ['未打疫苗', '已打疫苗', '疫苗未知'],
		infoSterilization: ['未绝育', '已绝育', '绝育未知'],
		infoDewo: ['未驱虫', '已驱虫', '驱虫未知']
	}
	return strategy[type][state]
})
const app = new Vue({
	...App
})
app.$mount()
